﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SuperKnowledgeDatabase2000Client
{
    /// <summary>
    /// Interaktionslogik für Window1.xaml
    /// </summary>
    public partial class RemoveDocument : Window
    {
        public bool removeAction = false;

        public RemoveDocument()
        {
            InitializeComponent();
        }

        /// <summary>
        /// renders UI conent
        /// </summary>
        /// <param name="e"></param>
        protected override void OnContentRendered(EventArgs e)
        {
            this.Activate();
            base.OnContentRendered(e);
            btn_dontRemove.Focus();       
        }

        /// <summary>
        /// remove action
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Remove(object sender, RoutedEventArgs e)
        {
            removeAction = true;   
            this.Close();
        }

        /// <summary>
        /// cancel action
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DontRemove(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        /// <summary>
        /// cancel operation, when user pushes the "Enter" button
        /// </summary>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnKeyDownHandler(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                this.Close();   
            }
        }
    }
}
